#include<bits/stdc++.h>
using namespace std;
int n,m,k,cnt;
int a[100005],b[100005],c[100005];
int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    k=0;
    for(int i=1;i<=n;i++){
        if(a[i]!=a[i-1])k++;
        b[k]++;
    }
    for(int i=1;i<=20;i++){
        c[i]=c[i-1]+b[i];
        int x=min(b[i],c[i-1]);
        cnt+=x;
        c[i]-=x;

    }
    cout<<n-cnt;
    return 0;
}
